<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">




<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
  </script>






<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />



  <link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico?v=5.1.4">







  <meta name="keywords" content="Swift," />





  <link rel="alternate" href="/atom.xml" title="Swift社区" type="application/atom+xml" />






<meta name="description" content="周报仓库：https://github.com/SwiftCommunityRes 前言California streaming. 我们都知道这意味着什么：马上将迎来重要的一天 —— Apple 宣布了 9 月 14 日的活动！ 他们在活动邀请中隐藏了一个彩蛋 —— 一种隐藏的 AR 体验，看起来很酷。 这也让全球的粉丝们纷纷猜测 Apple 即将发布的产品。 过去两周 Swift 社区非常活跃。">
<meta name="keywords" content="Swift">
<meta property="og:type" content="article">
<meta property="og:title" content="Swift 周报 第二期">
<meta property="og:url" content="https://fanbaoying.github.io/Swift-周报-第二期/index.html">
<meta property="og:site_name" content="Swift社区">
<meta property="og:description" content="周报仓库：https://github.com/SwiftCommunityRes 前言California streaming. 我们都知道这意味着什么：马上将迎来重要的一天 —— Apple 宣布了 9 月 14 日的活动！ 他们在活动邀请中隐藏了一个彩蛋 —— 一种隐藏的 AR 体验，看起来很酷。 这也让全球的粉丝们纷纷猜测 Apple 即将发布的产品。 过去两周 Swift 社区非常活跃。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png">
<meta property="og:image" content="https://files.mdnice.com/user/17787/9a7911bf-75f2-40f5-866b-3171868bb92c.jpg">
<meta property="og:updated_time" content="2021-10-22T07:17:56.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Swift 周报 第二期">
<meta name="twitter:description" content="周报仓库：https://github.com/SwiftCommunityRes 前言California streaming. 我们都知道这意味着什么：马上将迎来重要的一天 —— Apple 宣布了 9 月 14 日的活动！ 他们在活动邀请中隐藏了一个彩蛋 —— 一种隐藏的 AR 体验，看起来很酷。 这也让全球的粉丝们纷纷猜测 Apple 即将发布的产品。 过去两周 Swift 社区非常活跃。">
<meta name="twitter:image" content="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://fanbaoying.github.io/Swift-周报-第二期/"/>





  <title>Swift 周报 第二期 | Swift社区</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>
    
    <a href="https://github.com/SwiftCommunityRes" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
    
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Swift社区</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">做最好的 Swift 社区</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://fanbaoying.github.io/Swift-周报-第二期/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Swift社区">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://avatars.githubusercontent.com/u/84354365?v=4">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Swift社区">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Swift 周报 第二期</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2021-10-22T15:16:35+08:00">
                2021-10-22
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Swift-周报/" itemprop="url" rel="index">
                    <span itemprop="name">Swift 周报</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                -->
                <span title="字数统计">
                  数字统计 3,240字
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>

                <!-- 
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                --> 

                <span title="阅读时长">
                  阅读时长 12分钟
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>周报仓库：<a href="https://github.com/SwiftCommunityRes" target="_blank" rel="noopener">https://github.com/SwiftCommunityRes</a></p>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p><a href="https://www.apple.com/apple-events/" title="California streaming" target="_blank" rel="noopener">California streaming</a>. 我们都知道这意味着什么：马上将迎来重要的一天 —— <code>Apple</code> 宣布了 <strong>9 月 14 日</strong>的活动！ 他们在活动邀请中隐藏了一个彩蛋 —— <a href="https://9to5mac.com/2021/09/07/apple-hypes-next-weeks-iphone-13-event-with-ar-portal-experience/" title="一种隐藏的 AR 体验" target="_blank" rel="noopener">一种隐藏的 AR 体验</a>，看起来很酷。 这也让全球的粉丝们纷纷猜测 <code>Apple</code> 即将发布的产品。</p>
<p>过去两周 <code>Swift 社区</code>非常活跃。 许多提案正在 <code>Swift</code> 迭代中产生，有些已经同意或拒绝，有些仍在审查中。 这些提议有助于促进 <code>Swift</code> 保持现代语言的地位，所以让我们继续努力吧！</p>
<a id="more"></a>
<h2 id="新闻和社区"><a href="#新闻和社区" class="headerlink" title="新闻和社区"></a>新闻和社区</h2><p><a href="https://twitter.com/johnsundell" title="John Sundell" target="_blank" rel="noopener">John Sundell</a> 写了一篇文章解释  <a href="https://www.swiftbysundell.com/articles/conditional-compilation-within-swift-expressions/" title="Conditional compilation within Swift expressions" target="_blank" rel="noopener">Swift 表达式中的条件编译</a>。</p>
<p><a href="https://twitter.com/gabtheodor" title="Gabriel Theodoropoulos" target="_blank" rel="noopener">Gabriel Theodoropoulos</a> 写了一篇博文解释了如何<a href="https://serialcoder.dev/text-tutorials/swift-tutorials/using-variadic-parameters-in-swift/" title="Using Variadic Parameters in Swift" target="_blank" rel="noopener">在 Swift 中使用可变参数</a>。</p>
<h2 id="Commits-和-pull-requests"><a href="#Commits-和-pull-requests" class="headerlink" title="Commits 和 pull requests"></a>Commits 和 pull requests</h2><p><a href="https://twitter.com/dgregor79" title="Doug Gregor" target="_blank" rel="noopener">Doug Gregor</a> 合并了一个 <code>pull request</code>，该请求<a href="https://github.com/apple/swift/pull/39051" title="Add an option to build the concurrency library for back deployment" target="_blank" rel="noopener">添加了一个选项来构建并发库以进行后端部署</a>。</p>
<p><a href="https://github.com/fwcd" title="FW" target="_blank" rel="noopener">FW</a> 合并了一个<a href="https://github.com/apple/sourcekit-lsp/pull/414" title="
Implement semantic highlighting for Swift" target="_blank" rel="noopener">为 Swift 实现语义高亮</a> 的 <code>pull request</code>。</p>
<h2 id="同意的提案"><a href="#同意的提案" class="headerlink" title="同意的提案"></a>同意的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0321-package-registry-publish.md" title="SE-0321" target="_blank" rel="noopener">SE-0321</a> Package Registry Service - Publish Endpoint 已被<a href="https://forums.swift.org/t/accepted-se-0321-package-registry-service-publish-endpoint/51660" title="Package Registry Service - Publish Endpoint" target="_blank" rel="noopener">接受</a>。</p>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0304-structured-concurrency.md" title="SE-0304" target="_blank" rel="noopener">SE-0304</a> Structured Concurrency <a href="https://forums.swift.org/t/se-0304-4th-review-structured-concurrency/50281" title="SE-0304 (4th review): Structured Concurrency" target="_blank" rel="noopener">第四次</a>审查被<a href="https://forums.swift.org/t/accepted-with-modifications-se-0304-structured-concurrency/51850" title="[Accepted with modifications] SE-0304: Structured Concurrency" target="_blank" rel="noopener">接受</a>。</p>
<h2 id="拒绝的提案"><a href="#拒绝的提案" class="headerlink" title="拒绝的提案"></a>拒绝的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0320-codingkeyrepresentable.md" title="SE-0320" target="_blank" rel="noopener">SE-0320</a> 已返回进行<a href="https://forums.swift.org/t/returned-for-revision-se-0320-coding-of-non-string-int-keyed-dictionary-into-a-keyedcontainer/51706" title="[Returned for revision] SE-0320: Coding of non String / Int keyed Dictionary into a KeyedContainer" target="_blank" rel="noopener">修订</a>。</p>
<p>审查的反馈是积极的，社区成员建议作者和核心团队认为可以采用以下几项改进：</p>
<ol>
<li>在 <code>CodingKeyRepresentable</code> 中添加 <code>String</code> 和 <code>Int</code> 的一致性，这将允许在 <code>CodingKeyRepresentable</code> 用作通用约束时主动使用 <code>String</code> 和 <code>Int</code> 键。</li>
<li>使 <code>CodingKeyRepresentable</code> 协议的初始化通用。</li>
<li>为 <code>RawRepresentable</code> 的一致性提供默认实现（带有 <code>String</code> 和 <code>Int</code> 原始值）。</li>
<li>使内部 <code>_DictionaryCodingKey</code> 的初始值设定项 non-failable。</li>
</ol>
<h2 id="正在审查的提案"><a href="#正在审查的提案" class="headerlink" title="正在审查的提案"></a>正在审查的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0320-codingkeyrepresentable.md" title="SE-0320" target="_blank" rel="noopener">SE-0320</a>：允许将非 <code>String</code> / <code>Int</code> 键值 <code>Dictionary</code> 编码到 <code>KeyedContainer</code> 中 正在<a href="https://forums.swift.org/t/se-0320-2nd-review-coding-of-non-string-int-keyed-dictionary-into-a-keyedcontainer/51710" title="SE-0320 (2nd review): Coding of non String / Int keyed Dictionary into a KeyedContainer" target="_blank" rel="noopener">接受第二次审查</a>。</p>
<ul>
<li>第二次审查的重点是社区在第一次审查期间提出的改进建议，并通过 <a href="https://github.com/apple/swift-evolution/pull/1435" title="swift-evolution#1435" target="_blank" rel="noopener">swift-evolution#1435</a> 进行讨论。</li>
</ul>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0292-package-registry-service.md" title="SE-0292" target="_blank" rel="noopener">SE-0292</a>：Package Registry Service 修正<a href="https://github.com/apple/swift-evolution/pull/1410" title="修正 SE-0292 #1410" target="_blank" rel="noopener">正在审查中</a>。</p>
<p><a href="https://forums.swift.org/t/amendment-se-0303-package-manager-extensible-build-tools/51763" title="SE-0303: Package Manager Extensible Build Tools" target="_blank" rel="noopener">SE-0303</a>：包管理器可扩展构建工具修正<a href="https://github.com/apple/swift-evolution/pull/1434" title="Amend SE-0303 to use @main for plugin entry point and adjust API accordingly #1434 " target="_blank" rel="noopener">正在审查中</a>。</p>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0322-temporary-buffers.md" title="SE-0322" target="_blank" rel="noopener">SE-0322</a>：正在审查<a href="https://forums.swift.org/t/se-0322-temporary-uninitialized-buffers/51848" title="Temporary uninitialized buffers" target="_blank" rel="noopener">临时未初始化缓冲区</a>。</p>
<ul>
<li>该提案引入了新的标准库功能，用于操作临时缓冲区，这些缓冲区优先分配给堆栈，而不是堆。</li>
<li><code>Swift-evolution</code> 线程：[Pitch] <a href="https://forums.swift.org/t/pitch-temporary-uninitialized-buffers/48954" title="Temporary uninitialized buffers" target="_blank" rel="noopener">临时未初始化缓冲区</a></li>
</ul>
<h2 id="Swift-论坛"><a href="#Swift-论坛" class="headerlink" title="Swift 论坛"></a>Swift 论坛</h2><p><a href="https://github.com/maustinstar" title="Michael Verges" target="_blank" rel="noopener">Michael Verges</a> 提出了<a href="https://forums.swift.org/t/pitching-optional-throws-in-swift/51650" title="Pitching Optional Throws in Swift" target="_blank" rel="noopener">在 Swift 中添加可选 <code>throws</code> 的提案</a>。</p>
<ul>
<li>在许多情况下，错误处理的权限不明确。开发者可能会质疑是处理还是传播错误。</li>
<li>选择抛出错误可以让调用者灵活地处理问题。</li>
<li>选择不抛出错误是为用户提供了简化语法（没有 <code>do-try-catch</code>）。</li>
</ul>
<p><a href="https://forums.swift.org/t/api-changes-for-0-2-0/51647" title="Karl" target="_blank" rel="noopener">Karl</a> 向社区通报了 <a href="https://karwa.github.io/swift-url/" title="WebURL" target="_blank" rel="noopener">WebURL</a> 0.2.0 版。</p>
<ul>
<li>我正准备发布 <code>WebURL 0.2.0</code> 版本 。 这将是一个非常重要的版本，包括用于与 <code>System.framework</code> 和 <code>swift-system</code> 包集成的 <code>WebURLSystemExtras</code> 模块，并使项目与 <code>URL</code> 标准的最新版本保持一致。</li>
</ul>
<p><a href="https://forums.swift.org/categories" title="Patrick Goley" target="_blank" rel="noopener">Patrick Goley</a> 提出了<a href="https://forums.swift.org/t/pitch-destructuring-assignment-of-structs-and-classes/51593" title="Destructuring Assignment of Structs and Classes" target="_blank" rel="noopener">添加结构和类的析构赋值</a>的建议。</p>
<ul>
<li>析构赋值是一项语言功能，允许你提取值的多个部分，并将其分配给单个赋值语句中的多个变量。</li>
</ul>
<p><a href="https://twitter.com/stephentyrone" title="Steve Canon" target="_blank" rel="noopener">Steve Canon</a> 宣布 <a href="https://forums.swift.org/t/1-0-0-release-notes/51641" title="Swift Numerics" target="_blank" rel="noopener">Swift Numerics</a> 的第一个稳定版本现已发布。</p>
<p>Austin 开始讨论 <a href="https://forums.swift.org/t/netlink-socket-support-in-swiftnio/51651" title="Netlink socket support in SwiftNIO" target="_blank" rel="noopener">SwiftNIO 中的 netlink 套接字支持</a>。</p>
<p><a href="https://forums.swift.org/categories" title="Konrad ktoso Malawski" target="_blank" rel="noopener">Konrad ktoso Malawski</a> 提出了一项实施 <a href="https://forums.swift.org/t/pitch-distributed-actors/51669" title="Distributed Actors" target="_blank" rel="noopener">Distributed Actors</a> 的提案。 </p>
<ul>
<li>随着最近 <code>Swift</code> 并发的引入，特别是该语言的参与者，<code>Swift</code> 在表达线程安全的并发程序方面获得了强大的基础构建。该提案旨在通过引入分布式参与者和与他们相关的位置透明度，扩大 <code>Swift</code>的参与者在分布式系统方面同样出色的工作能力。</li>
</ul>
<p><a href="https://twitter.com/maxdesiatov" title="Max Desiatov" target="_blank" rel="noopener">Max Desiatov</a> 告诉我们 <a href="https://forums.swift.org/t/swiftwasm-5-4-0-has-been-released/51753" title="SwiftWasm 5.4.0 has been released" target="_blank" rel="noopener">SwiftWasm 5.4.0</a> 已经发布。</p>
<ul>
<li>此版本与 <code>upstream</code> <code>Swift 5.4</code> 匹配，并允许您将 <code>Swift</code> 应用程序（只要它们不使用特定于其他平台的代码）编译到 <code>WebAssembly</code>，甚至可以在浏览器中运行。</li>
</ul>
<p><a href="https://forums.swift.org/categories" title="elsh" target="_blank" rel="noopener">elsh</a> 提出了添加<a href="https://forums.swift.org/t/pitch-module-aliasing/51737" title="Module Aliasing" target="_blank" rel="noopener">模块别名</a>支持的建议。</p>
<p>随着 <code>Swift</code> 库和软件包分布更加广泛，模块名称有时会发生冲突。由于 <code>Swift</code> 中还没有模块命名空间，在这种情况下，库经常被迫重命名或固定在旧的非冲突版本上。这使得以下用例具有挑战性：</p>
<ul>
<li><p>添加新的依赖项或升级，因为它可能会引入冲突：一个新的（或升级的）模块可以与依赖关系图中已经存在的另一个模块具有相同的名称。模块名称 <code>Logging</code> 是一个常见示例。</p>
</li>
<li><p>从上游库固定的旧版本升级到软件包的更新版本：考虑这样一个场景，其中 <code>MyApp</code> 依赖于模块 <code>Lib</code>，而 <code>Lib</code> 依赖于模块 <code>Logging</code>。 <code>MyApp</code> 还依赖于 <code>Logging</code>。 如果 <code>Lib</code> 固定到 <code>Logging 1.0.0</code>，则 <code>MyApp</code> 会停留在同一版本 <code>1.0.0</code>。</p>
</li>
</ul>
<p>2021年9月3日，服务器工作组的 <code>Swift</code> 宣布了一项<a href="https://forums.swift.org/t/september-3rd-2021-special-update/51766" title="September 3rd, 2021 Special Update" target="_blank" rel="noopener">特别更新</a>。</p>
<p><a href="https://forums.swift.org/t/pitch-introduce-expanded-parameters/51885" title="Introduce Expanded Parameters" target="_blank" rel="noopener">Isabel Lima</a> 向我们更新了有关<a href="https://forums.swift.org/t/add-shared-storage-to-property-wrappers/49898" title="Add shared storage to property wrappers " target="_blank" rel="noopener">添加 Property Wrappers 共享存储</a>的状态。</p>
<ul>
<li><code>Swift</code> 是一种允许我们编写富有表现力的 <code>API</code> 接口语言。通过<strong>约束泛型</strong>、<strong>方法重载</strong>、<strong>尾随闭包</strong>和<strong>默认参数</strong>等功能，您可以在实现相当灵活的 <code>API</code>的同时减少代码重复。本提案旨在使用 <code>@expanded</code>（函数参数的新属性）增加语言的这一部分。</li>
</ul>
<p><a href="https://github.com/johnno1962" title="John Holdsworth" target="_blank" rel="noopener">John Holdsworth</a> 提议引入 <a href="https://forums.swift.org/t/introducing-an-unwrap-or-throw-operator/51905" title="Introducing an “Unwrap or Throw” operator" target="_blank" rel="noopener"> Unwrap 或 Throw 运算符</a>。</p>
<ul>
<li><p>该提议是之前 <a href="https://forums.swift.org/t/pitch-introducing-the-unwrap-or-die-operator-to-the-standard-library/6207" title="[Pitch] Introducing the “Unwrap or Die” operator to the standard library" target="_blank" rel="noopener">[Pitch] Introducing the “Unwrap or Die” operator to the standard library</a> 以及最近 <a href="https://forums.swift.org/t/moving-toward-deprecating-force-unwrap-from-swift/43455" title="Moving toward deprecating force unwrap from Swift?" target="_blank" rel="noopener">Moving toward deprecating force unwrap from Swift?</a> 两个有争议提议的延伸。 后一个提议除了被锁定之外没有得出结论，这个提议在前一个提议上取而代之，建议使用 “<code>Unwrap or Throw</code>” 运算符可能是解决 <code>Swift</code> 中强制解包问题的更好解决方案，这让我很疑惑，我相信当用户的应用程序崩溃时，会影响到用户使用。</p>
</li>
<li><h1 id="总之，我想提出一个-运算符，强制打开和-nil-并之间的交叉，如果可选是-nil，则抛出。"><a href="#总之，我想提出一个-运算符，强制打开和-nil-并之间的交叉，如果可选是-nil，则抛出。" class="headerlink" title="总之，我想提出一个 !! 运算符，强制打开和 nil 并之间的交叉，如果可选是 nil，则抛出。"></a>总之，我想提出一个 <code>!!</code> 运算符，强制打开和 <code>nil</code> 并之间的交叉，如果可选是 <code>nil</code>，则抛出。</h1><h2 id="前言-1"><a href="#前言-1" class="headerlink" title="前言"></a>前言</h2></li>
</ul>
<p><a href="https://www.apple.com/apple-events/" title="California streaming" target="_blank" rel="noopener">California streaming</a>. 我们都知道这意味着什么：马上将迎来重要的一天 —— <code>Apple</code> 宣布了 <strong>9 月 14 日</strong>的活动！ 他们在活动邀请中隐藏了一个彩蛋 —— <a href="https://9to5mac.com/2021/09/07/apple-hypes-next-weeks-iphone-13-event-with-ar-portal-experience/" title="一种隐藏的 AR 体验" target="_blank" rel="noopener">一种隐藏的 AR 体验</a>，看起来很酷。 这也让全球的粉丝们纷纷猜测 <code>Apple</code> 即将发布的产品。</p>
<p>过去两周 <code>Swift 社区</code>非常活跃。 许多提案正在 <code>Swift</code> 迭代中产生，有些已经同意或拒绝，有些仍在审查中。 这些提议有助于促进 <code>Swift</code> 保持现代语言的地位，所以让我们继续努力吧！</p>
<h2 id="新闻和社区-1"><a href="#新闻和社区-1" class="headerlink" title="新闻和社区"></a>新闻和社区</h2><p><a href="https://twitter.com/johnsundell" title="John Sundell" target="_blank" rel="noopener">John Sundell</a> 写了一篇文章解释  <a href="https://www.swiftbysundell.com/articles/conditional-compilation-within-swift-expressions/" title="Conditional compilation within Swift expressions" target="_blank" rel="noopener">Swift 表达式中的条件编译</a>。</p>
<p><a href="https://twitter.com/gabtheodor" title="Gabriel Theodoropoulos" target="_blank" rel="noopener">Gabriel Theodoropoulos</a> 写了一篇博文解释了如何<a href="https://serialcoder.dev/text-tutorials/swift-tutorials/using-variadic-parameters-in-swift/" title="Using Variadic Parameters in Swift" target="_blank" rel="noopener">在 Swift 中使用可变参数</a>。</p>
<h2 id="Commits-和-pull-requests-1"><a href="#Commits-和-pull-requests-1" class="headerlink" title="Commits 和 pull requests"></a>Commits 和 pull requests</h2><p><a href="https://twitter.com/dgregor79" title="Doug Gregor" target="_blank" rel="noopener">Doug Gregor</a> 合并了一个 <code>pull request</code>，该请求<a href="https://github.com/apple/swift/pull/39051" title="Add an option to build the concurrency library for back deployment" target="_blank" rel="noopener">添加了一个选项来构建并发库以进行后端部署</a>。</p>
<p><a href="https://github.com/fwcd" title="FW" target="_blank" rel="noopener">FW</a> 合并了一个<a href="https://github.com/apple/sourcekit-lsp/pull/414" title="
Implement semantic highlighting for Swift" target="_blank" rel="noopener">为 Swift 实现语义高亮</a> 的 <code>pull request</code>。</p>
<h2 id="同意的提案-1"><a href="#同意的提案-1" class="headerlink" title="同意的提案"></a>同意的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0321-package-registry-publish.md" title="SE-0321" target="_blank" rel="noopener">SE-0321</a> Package Registry Service - Publish Endpoint 已被<a href="https://forums.swift.org/t/accepted-se-0321-package-registry-service-publish-endpoint/51660" title="Package Registry Service - Publish Endpoint" target="_blank" rel="noopener">接受</a>。</p>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0304-structured-concurrency.md" title="SE-0304" target="_blank" rel="noopener">SE-0304</a> Structured Concurrency <a href="https://forums.swift.org/t/se-0304-4th-review-structured-concurrency/50281" title="SE-0304 (4th review): Structured Concurrency" target="_blank" rel="noopener">第四次</a>审查被<a href="https://forums.swift.org/t/accepted-with-modifications-se-0304-structured-concurrency/51850" title="[Accepted with modifications] SE-0304: Structured Concurrency" target="_blank" rel="noopener">接受</a>。</p>
<h2 id="拒绝的提案-1"><a href="#拒绝的提案-1" class="headerlink" title="拒绝的提案"></a>拒绝的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0320-codingkeyrepresentable.md" title="SE-0320" target="_blank" rel="noopener">SE-0320</a> 已返回进行<a href="https://forums.swift.org/t/returned-for-revision-se-0320-coding-of-non-string-int-keyed-dictionary-into-a-keyedcontainer/51706" title="[Returned for revision] SE-0320: Coding of non String / Int keyed Dictionary into a KeyedContainer" target="_blank" rel="noopener">修订</a>。</p>
<p>审查的反馈是积极的，社区成员建议作者和核心团队认为可以采用以下几项改进：</p>
<ol>
<li>在 <code>CodingKeyRepresentable</code> 中添加 <code>String</code> 和 <code>Int</code> 的一致性，这将允许在 <code>CodingKeyRepresentable</code> 用作通用约束时主动使用 <code>String</code> 和 <code>Int</code> 键。</li>
<li>使 <code>CodingKeyRepresentable</code> 协议的初始化通用。</li>
<li>为 <code>RawRepresentable</code> 的一致性提供默认实现（带有 <code>String</code> 和 <code>Int</code> 原始值）。</li>
<li>使内部 <code>_DictionaryCodingKey</code> 的初始值设定项 non-failable。</li>
</ol>
<h2 id="正在审查的提案-1"><a href="#正在审查的提案-1" class="headerlink" title="正在审查的提案"></a>正在审查的提案</h2><p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0320-codingkeyrepresentable.md" title="SE-0320" target="_blank" rel="noopener">SE-0320</a>：允许将非 <code>String</code> / <code>Int</code> 键值 <code>Dictionary</code> 编码到 <code>KeyedContainer</code> 中 正在<a href="https://forums.swift.org/t/se-0320-2nd-review-coding-of-non-string-int-keyed-dictionary-into-a-keyedcontainer/51710" title="SE-0320 (2nd review): Coding of non String / Int keyed Dictionary into a KeyedContainer" target="_blank" rel="noopener">接受第二次审查</a>。</p>
<ul>
<li>第二次审查的重点是社区在第一次审查期间提出的改进建议，并通过 <a href="https://github.com/apple/swift-evolution/pull/1435" title="swift-evolution#1435" target="_blank" rel="noopener">swift-evolution#1435</a> 进行讨论。</li>
</ul>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0292-package-registry-service.md" title="SE-0292" target="_blank" rel="noopener">SE-0292</a>：Package Registry Service 修正<a href="https://github.com/apple/swift-evolution/pull/1410" title="修正 SE-0292 #1410" target="_blank" rel="noopener">正在审查中</a>。</p>
<p><a href="https://forums.swift.org/t/amendment-se-0303-package-manager-extensible-build-tools/51763" title="SE-0303: Package Manager Extensible Build Tools" target="_blank" rel="noopener">SE-0303</a>：包管理器可扩展构建工具修正<a href="https://github.com/apple/swift-evolution/pull/1434" title="Amend SE-0303 to use @main for plugin entry point and adjust API accordingly #1434 " target="_blank" rel="noopener">正在审查中</a>。</p>
<p><a href="https://github.com/apple/swift-evolution/blob/main/proposals/0322-temporary-buffers.md" title="SE-0322" target="_blank" rel="noopener">SE-0322</a>：正在审查<a href="https://forums.swift.org/t/se-0322-temporary-uninitialized-buffers/51848" title="Temporary uninitialized buffers" target="_blank" rel="noopener">临时未初始化缓冲区</a>。</p>
<ul>
<li>该提案引入了新的标准库功能，用于操作临时缓冲区，这些缓冲区优先分配给堆栈，而不是堆。</li>
<li><code>Swift-evolution</code> 线程：[Pitch] <a href="https://forums.swift.org/t/pitch-temporary-uninitialized-buffers/48954" title="Temporary uninitialized buffers" target="_blank" rel="noopener">临时未初始化缓冲区</a></li>
</ul>
<h2 id="Swift-论坛-1"><a href="#Swift-论坛-1" class="headerlink" title="Swift 论坛"></a>Swift 论坛</h2><p><a href="https://github.com/maustinstar" title="Michael Verges" target="_blank" rel="noopener">Michael Verges</a> 提出了<a href="https://forums.swift.org/t/pitching-optional-throws-in-swift/51650" title="Pitching Optional Throws in Swift" target="_blank" rel="noopener">在 Swift 中添加可选 <code>throws</code> 的提案</a>。</p>
<ul>
<li>在许多情况下，错误处理的权限不明确。开发者可能会质疑是处理还是传播错误。</li>
<li>选择抛出错误可以让调用者灵活地处理问题。</li>
<li>选择不抛出错误是为用户提供了简化语法（没有 <code>do-try-catch</code>）。</li>
</ul>
<p><a href="https://forums.swift.org/t/api-changes-for-0-2-0/51647" title="Karl" target="_blank" rel="noopener">Karl</a> 向社区通报了 <a href="https://karwa.github.io/swift-url/" title="WebURL" target="_blank" rel="noopener">WebURL</a> 0.2.0 版。</p>
<ul>
<li>我正准备发布 <code>WebURL 0.2.0</code> 版本 。 这将是一个非常重要的版本，包括用于与 <code>System.framework</code> 和 <code>swift-system</code> 包集成的 <code>WebURLSystemExtras</code> 模块，并使项目与 <code>URL</code> 标准的最新版本保持一致。</li>
</ul>
<p><a href="https://forums.swift.org/categories" title="Patrick Goley" target="_blank" rel="noopener">Patrick Goley</a> 提出了<a href="https://forums.swift.org/t/pitch-destructuring-assignment-of-structs-and-classes/51593" title="Destructuring Assignment of Structs and Classes" target="_blank" rel="noopener">添加结构和类的析构赋值</a>的建议。</p>
<ul>
<li>析构赋值是一项语言功能，允许你提取值的多个部分，并将其分配给单个赋值语句中的多个变量。</li>
</ul>
<p><a href="https://twitter.com/stephentyrone" title="Steve Canon" target="_blank" rel="noopener">Steve Canon</a> 宣布 <a href="https://forums.swift.org/t/1-0-0-release-notes/51641" title="Swift Numerics" target="_blank" rel="noopener">Swift Numerics</a> 的第一个稳定版本现已发布。</p>
<p>Austin 开始讨论 <a href="https://forums.swift.org/t/netlink-socket-support-in-swiftnio/51651" title="Netlink socket support in SwiftNIO" target="_blank" rel="noopener">SwiftNIO 中的 netlink 套接字支持</a>。</p>
<p><a href="https://forums.swift.org/categories" title="Konrad ktoso Malawski" target="_blank" rel="noopener">Konrad ktoso Malawski</a> 提出了一项实施 <a href="https://forums.swift.org/t/pitch-distributed-actors/51669" title="Distributed Actors" target="_blank" rel="noopener">Distributed Actors</a> 的提案。 </p>
<ul>
<li>随着最近 <code>Swift</code> 并发的引入，特别是该语言的参与者，<code>Swift</code> 在表达线程安全的并发程序方面获得了强大的基础构建。该提案旨在通过引入分布式参与者和与他们相关的位置透明度，扩大 <code>Swift</code>的参与者在分布式系统方面同样出色的工作能力。</li>
</ul>
<p><a href="https://twitter.com/maxdesiatov" title="Max Desiatov" target="_blank" rel="noopener">Max Desiatov</a> 告诉我们 <a href="https://forums.swift.org/t/swiftwasm-5-4-0-has-been-released/51753" title="SwiftWasm 5.4.0 has been released" target="_blank" rel="noopener">SwiftWasm 5.4.0</a> 已经发布。</p>
<ul>
<li>此版本与 <code>upstream</code> <code>Swift 5.4</code> 匹配，并允许您将 <code>Swift</code> 应用程序（只要它们不使用特定于其他平台的代码）编译到 <code>WebAssembly</code>，甚至可以在浏览器中运行。</li>
</ul>
<p><a href="https://forums.swift.org/categories" title="elsh" target="_blank" rel="noopener">elsh</a> 提出了添加<a href="https://forums.swift.org/t/pitch-module-aliasing/51737" title="Module Aliasing" target="_blank" rel="noopener">模块别名</a>支持的建议。</p>
<p>随着 <code>Swift</code> 库和软件包分布更加广泛，模块名称有时会发生冲突。由于 <code>Swift</code> 中还没有模块命名空间，在这种情况下，库经常被迫重命名或固定在旧的非冲突版本上。这使得以下用例具有挑战性：</p>
<ul>
<li><p>添加新的依赖项或升级，因为它可能会引入冲突：一个新的（或升级的）模块可以与依赖关系图中已经存在的另一个模块具有相同的名称。模块名称 <code>Logging</code> 是一个常见示例。</p>
</li>
<li><p>从上游库固定的旧版本升级到软件包的更新版本：考虑这样一个场景，其中 <code>MyApp</code> 依赖于模块 <code>Lib</code>，而 <code>Lib</code> 依赖于模块 <code>Logging</code>。 <code>MyApp</code> 还依赖于 <code>Logging</code>。 如果 <code>Lib</code> 固定到 <code>Logging 1.0.0</code>，则 <code>MyApp</code> 会停留在同一版本 <code>1.0.0</code>。</p>
</li>
</ul>
<p>2021年9月3日，服务器工作组的 <code>Swift</code> 宣布了一项<a href="https://forums.swift.org/t/september-3rd-2021-special-update/51766" title="September 3rd, 2021 Special Update" target="_blank" rel="noopener">特别更新</a>。</p>
<p><a href="https://forums.swift.org/t/pitch-introduce-expanded-parameters/51885" title="Introduce Expanded Parameters" target="_blank" rel="noopener">Isabel Lima</a> 向我们更新了有关<a href="https://forums.swift.org/t/add-shared-storage-to-property-wrappers/49898" title="Add shared storage to property wrappers " target="_blank" rel="noopener">添加 Property Wrappers 共享存储</a>的状态。</p>
<ul>
<li><code>Swift</code> 是一种允许我们编写富有表现力的 <code>API</code> 接口语言。通过<strong>约束泛型</strong>、<strong>方法重载</strong>、<strong>尾随闭包</strong>和<strong>默认参数</strong>等功能，您可以在实现相当灵活的 <code>API</code>的同时减少代码重复。本提案旨在使用 <code>@expanded</code>（函数参数的新属性）增加语言的这一部分。</li>
</ul>
<p><a href="https://github.com/johnno1962" title="John Holdsworth" target="_blank" rel="noopener">John Holdsworth</a> 提议引入 <a href="https://forums.swift.org/t/introducing-an-unwrap-or-throw-operator/51905" title="Introducing an “Unwrap or Throw” operator" target="_blank" rel="noopener"> Unwrap 或 Throw 运算符</a>。</p>
<ul>
<li><p>该提议是之前 <a href="https://forums.swift.org/t/pitch-introducing-the-unwrap-or-die-operator-to-the-standard-library/6207" title="[Pitch] Introducing the “Unwrap or Die” operator to the standard library" target="_blank" rel="noopener">[Pitch] Introducing the “Unwrap or Die” operator to the standard library</a> 以及最近 <a href="https://forums.swift.org/t/moving-toward-deprecating-force-unwrap-from-swift/43455" title="Moving toward deprecating force unwrap from Swift?" target="_blank" rel="noopener">Moving toward deprecating force unwrap from Swift?</a> 两个有争议提议的延伸。 后一个提议除了被锁定之外没有得出结论，这个提议在前一个提议上取而代之，建议使用 “<code>Unwrap or Throw</code>” 运算符可能是解决 <code>Swift</code> 中强制解包问题的更好解决方案，这让我很疑惑，我相信当用户的应用程序崩溃时，会影响到用户使用。</p>
</li>
<li><p>总之，我想提出一个 <code>!!</code> 运算符，强制打开和 <code>nil</code> 并之间的交叉，如果可选是 <code>nil</code>，则抛出。</p>
</li>
</ul>
<h2 id="关于我们"><a href="#关于我们" class="headerlink" title="关于我们"></a>关于我们</h2><p>公众号是由 Swift 爱好者共同维护，我们会分享以 Swift 实战、SwiftUI、Swift 基础为核心的技术内容，也整理收集优秀的学习资料。欢迎关注公众号：<strong>Swift社区</strong>，后台点击进群，联系我们获取更多内容。</p>
<p><img width="500" alt="Swift社区" src="https://user-images.githubusercontent.com/24238160/132703149-34121c6c-fd18-491c-a697-58a0fabf3060.png"></p>
<p>感谢 SwiftWeekly 与我们的合作，开启 Swift 周报中文版发布之旅。周报仓库：<a href="https://github.com/SwiftCommunityRes" target="_blank" rel="noopener">https://github.com/SwiftCommunityRes</a></p>
<p>后续还会翻译大量资料到我们公众号，有感兴趣的朋友，可以加入我们，扫码添加微信</p>
<p><img width="300" alt="fzhanfei" src="https://files.mdnice.com/user/17787/9a7911bf-75f2-40f5-866b-3171868bb92c.jpg"></p>

      
    </div>
    
    
    
    

    
      <div>
        <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

      </div>
    


    
      <div>
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/Swift-周报-第二期/">Swift 周报 第二期</a></p>
  <p><span>文章作者:</span><a href="/" title="访问 Swift社区 的个人博客">Swift社区</a></p>
  <p><span>发布时间:</span>2021年10月22日 - 15:10</p>
  <p><span>最后更新:</span>2021年10月22日 - 15:10</p>
  <p><span>原始链接:</span><a href="/Swift-周报-第二期/" title="Swift 周报 第二期">https://fanbaoying.github.io/Swift-周报-第二期/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="https://fanbaoying.github.io/Swift-周报-第二期/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
      $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
        });
    });  
</script>

      </div>
    


    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechat.png" alt="Swift社区 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.png" alt="Swift社区 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Swift/" rel="tag"><i class="fa fa-tag"></i> Swift</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Swift-周报-第一期/" rel="next" title="Swift 周报 第一期">
                <i class="fa fa-chevron-left"></i> Swift 周报 第一期
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Swift-周报-第三期/" rel="prev" title="Swift 周报 第三期">
                Swift 周报 第三期 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        <!-- JiaThis Button BEGIN -->
<div class="jiathis_style">
<span class="jiathis_txt">分享到：</span>
<a class="jiathis_button_fav">收藏夹</a>
<a class="jiathis_button_copy">复制网址</a>
<a class="jiathis_button_email">邮件</a>
<a class="jiathis_button_weixin">微信</a>
<a class="jiathis_button_qzone">QQ空间</a>
<a class="jiathis_button_tqq">腾讯微博</a>
<a class="jiathis_button_douban">豆瓣</a>
<a class="jiathis_button_share">一键分享</a>

<a href="http://www.jiathis.com/share?uid=2140465" class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis" target="_blank">更多</a>
<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" >
var jiathis_config={
  data_track_clickback:true,
  summary:"",
  shortUrl:false,
  hideMore:false
}
</script>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=" charset="utf-8"></script>
<!-- JiaThis Button END -->
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="https://avatars.githubusercontent.com/u/84354365?v=4"
                alt="Swift社区" />
            
              <p class="site-author-name" itemprop="name">Swift社区</p>
              <p class="site-description motion-element" itemprop="description">我们的使命是做一个最专业最权威的 Swift 中文社区，我们的愿景是希望更多的人学习和使用Swift。我们会分享以 Swift 实战、SwiftUI、Swift 基础为核心的技术干货，不忘初心，牢记使命。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">187</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">19</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">11</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_36478920" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/5a30d987f265da430d580126" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-spinner"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/fanbaoying" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/swift-community" target="_blank" title="知乎">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>知乎</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/7711465033" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzAxNzgzNTgwMw==&action=getalbum&album_id=2024314764775981057" target="_blank" title="公众号">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>公众号</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftWeekly" title="SwiftWeekly" target="_blank">SwiftWeekly</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/article-ios" title="Article-ios" target="_blank">Article-ios</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://github.com/SwiftCommunityRes/SwiftUI-Book" title="SwiftUI-Book" target="_blank">SwiftUI-Book</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#新闻和社区"><span class="nav-number">2.</span> <span class="nav-text">新闻和社区</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Commits-和-pull-requests"><span class="nav-number">3.</span> <span class="nav-text">Commits 和 pull requests</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#同意的提案"><span class="nav-number">4.</span> <span class="nav-text">同意的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#拒绝的提案"><span class="nav-number">5.</span> <span class="nav-text">拒绝的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#正在审查的提案"><span class="nav-number">6.</span> <span class="nav-text">正在审查的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Swift-论坛"><span class="nav-number">7.</span> <span class="nav-text">Swift 论坛</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#总之，我想提出一个-运算符，强制打开和-nil-并之间的交叉，如果可选是-nil，则抛出。"><span class="nav-number"></span> <span class="nav-text">总之，我想提出一个 !! 运算符，强制打开和 nil 并之间的交叉，如果可选是 nil，则抛出。</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言-1"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#新闻和社区-1"><span class="nav-number">2.</span> <span class="nav-text">新闻和社区</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Commits-和-pull-requests-1"><span class="nav-number">3.</span> <span class="nav-text">Commits 和 pull requests</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#同意的提案-1"><span class="nav-number">4.</span> <span class="nav-text">同意的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#拒绝的提案-1"><span class="nav-number">5.</span> <span class="nav-text">拒绝的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#正在审查的提案-1"><span class="nav-number">6.</span> <span class="nav-text">正在审查的提案</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Swift-论坛-1"><span class="nav-number">7.</span> <span class="nav-text">Swift 论坛</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关于我们"><span class="nav-number">8.</span> <span class="nav-text">关于我们</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Swift社区</span>

  
</div>

<!-- 
<div class="powered-by">
  <i class="fa fa-user-md">
  </i>
  <span id="busuanzi_container_site_uv">
    已有<span id="busuanzi_value_site_uv"></span>人来访
  </span>

</div>


  <span class="post-meta-divider">|</span>


<div class="powered-by">
  <i class="fa fa-eye"></i>
  <span id="busuanzi_container_site_pv">
      访问量<span id="busuanzi_value_site_pv"></span>次
  </span>
</div>



  <span class="post-meta-divider">|</span>


-->

<div class="theme-info">
  <i class="fa fa-pencil"></i>
  <span class="post-count">博客全站共361.6k字</span>
</div>


<!-- 
  <span class="post-meta-divider">|</span>



  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>



-->

        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
